.global _memPutB
.global _memGetB
.global _memPutW
.global _memGetW
.global _div

;------------------------------------------------------------------------------
; Write a byte at address segment:offset.
; memputb(uint segment, uint offset, uchar byte)

_memPutB:
	push bp
	mov bp, sp

	push es
	push di
	mov ax, [bp+4]
	mov es, ax
	mov di, [bp+6]
	mov ax, [bp+8]
	seg es
	mov byte [di], al
	pop di
	pop es

	pop bp
	ret
	
_memPutW:
	push bp
	mov bp, sp

	push es
	push di
	mov ax, [bp+4]
	mov es, ax
	mov di, [bp+6]
	mov ax, [bp+8]
	seg es
	mov [di], ax
	pop di
	pop es

	pop bp
	ret
	
_memGetB:
	push bp
	mov bp, sp

	push es
	push di
	mov ax, [bp+4]
	mov es, ax
	mov di, [bp+6]
	mov ax, [bp+8]
	seg es
	mov al,byte [di]
	xor ah,ah
	pop di
	pop es

	pop bp
	ret

_memGetW:
	push bp
	mov bp, sp

	push es
	push di
	mov ax, [bp+4]
	mov es, ax
	mov di, [bp+6]
	mov ax, [bp+8]
	seg es
	mov ax,[di]
	pop di
	pop es

	pop bp
	ret

; div function
; Ici, eax vaut 3 et edx vaut 2.
_div:	
	mov dx,0
	mov ax,14
	mov bx,4
	div bx 

